package com.woniuxy.businessassembly.service.impl;

import com.woniuxy.businessassembly.model.HotelRoom;
import com.woniuxy.businessassembly.dao.HotelRoomMapper;
import com.woniuxy.businessassembly.service.IHotelRoomService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniuxy.hotel.form.RoomForm;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Kevin Kwok
 * @since 2021-05-24
 */
@Service
public class HotelRoomServiceImpl extends ServiceImpl<HotelRoomMapper, HotelRoom> implements IHotelRoomService {

    @Resource
    private HotelRoomMapper roomMapper;

    @Override
    public int addNewRoom(HotelRoom hotelRoom) {
        int i = roomMapper.addNewRoom(hotelRoom);
        return i;
    }

    @Override
    public int modifyRoom(HotelRoom hotelRoom, Integer roomId) {
        hotelRoom.setRoomId(roomId);
        int i = roomMapper.modifyRoom(hotelRoom);
        return i;
    }

    @Override
    public int deleteRoom(Integer roomId) {
        int i = roomMapper.deleteRoom(roomId);
        return i;
    }

    @Override
    public List<HotelRoom> queryAllRooms() {
        List<HotelRoom> hotelRooms = roomMapper.queryAllRooms();
        return hotelRooms;
    }

    @Override
    public List<HotelRoom> queryByFeature(String featrue) {
        List<HotelRoom> hotelRooms = roomMapper.queryByFeature(featrue);
        return hotelRooms;
    }

    @Override
    public List<HotelRoom> queryByType(String type) {
        List<HotelRoom> hotelRooms = roomMapper.queryByType(type);
        return hotelRooms;
    }
}
